package com.xpxrule.constant;

/**
 * @version 1.0
 * @Author xiangpengxiang
 * @Date 2025/1/7 14:59
 * @注释
 */
public enum ValueType {
    SINGLE("single", "单值"),
    RANGE("range", "范围值"),
    COLLECTION("collection", "集合值");
    ;
    private String type;
    private String desc;

    ValueType(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static ValueType getValueType(String type) {
        for (ValueType valueType : ValueType.values()) {
            if (valueType.getType().equals(type)) {
                return valueType;
            }
        }
        return null;
    }

    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }
}
